using System;
using System.Collections.Generic;

namespace Mercenary
{
    public class StraAutoMap : IStrategy
    {
        public static string m_name = UiItemConst.策略_自动推图.m_name;
        public List<MercCard> m_mercList = new List<MercCard>();

        public string Name() { return m_name; }

        public List<MercCard> GetMercList() { return m_mercList; }

        public (int hand_index, int play_index) GetEnterOrder(
            List<MercCard> hand_mercenaries,
            List<MercCard> play_mercenaries)
        {
            int 鞭笞者特里高雷 = UtilsStra.FindMercenaryIndexForName(
                "鞭笞者特里高雷", play_mercenaries);
            if (鞭笞者特里高雷 == 0)
                return (0, 鞭笞者特里高雷);
            else if (鞭笞者特里高雷 > 0)
                return (0, 鞭笞者特里高雷 + 1);
            return (0, play_mercenaries.Count);
        }

        public void UpdateMercList()
        {
            m_mercList.Clear();
            /*
            if(UtilsMap.GetCurrMap().m_name=="特殊关卡1")
            {
                //if(玩家收藏里面实际存在如下3个则一起添加，否则不添加，然后换一组佣兵)
                {
                    //m_mercList.Add(new MercCard(task.m_mercId,EquipConst.黑龙鳞片));
                    m_mercList.Add(new MercCard(MercConst.玉珑.m_id,0));
                    m_mercList.Add(new MercCard(MercConst.赤精.m_id, EquipConst.赤精之杖.m_id));
                }
                
            }
            else if(UtilsMap.GetCurrMap().m_name=="特殊关卡2")
            {
                //...
            }
            else
            {
                //普通火焰队伍，自燃队伍，AOE队伍等
                //最大添加6个，尽量添加满级厉害英雄，最大能力通关
            }
            */
        }

        public List<BattleTarget> GetBattleTargets(
            int turn,
            List<MercCard> targets_opposite_all,
            List<MercCard> targets_friendly_all,
            List<MercCard> targets_opposite_graveyrad)
        {
            var battleTargetEntities = new List<BattleTarget>();
            /*
            var maxHealthTarget = UtilsStra.FindMaxHealthTarget(targets_opposite);

            if(UtilsMap.GetCurrMap().m_name=="特殊关卡1")
            {
                var merc = UtilsStra.FindMercenaryForId(MercConst.玉珑.m_id, mercenaries);
                if(merc!=null)
                {
                    battleTargetEntities.Add(new BattleTarget()
                    {
                        m_oppoTarId = maxHealthTarget?.m_id ?? -1,
                        m_skillId = UtilsStra.FindSkillForName("玉火打击", merc)?.m_id ?? -1
                    });
                }
                merc = UtilsStra.FindMercenaryForId(MercConst.赤精.m_id, mercenaries);
                if(merc!=null)
                {
                    battleTargetEntities.Add(new BattleTarget()
                    {
                        m_oppoTarId = maxHealthTarget?.m_id ?? -1,
                        m_skillId = UtilsStra.FindSkillForName("振奋之歌", merc)?.m_id ?? -1
                    });
                }
            }
            else if(UtilsMap.GetCurrMap().m_name=="特殊关卡2")
            {
                //...
            }
            else
            {
                //普通火焰队伍，自燃队伍，AOE队伍技能释放
            }
            */

            return battleTargetEntities;
        }
    }
}
